package com.spark.controller;

import com.spark.entity.BusTypeMsgSendVO;
import com.spark.service.producer.BusTypeMsgProducer;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.UUID;

/**
 * @Author sc
 * @DATE 2024/5/23 15:03
 * @Description:
 * @Version 1.0
 */
@RestController
@RequiredArgsConstructor
public class SimpleRabbitMqController {

    private final BusTypeMsgProducer busTypeMsgProducer;

    @GetMapping("/produce")
    public BusTypeMsgSendVO produce() {
        BusTypeMsgSendVO vo = new BusTypeMsgSendVO();
        vo.setPriKey(UUID.randomUUID().toString());
        vo.setPhoneNum("xxxxxxxxxxx");
        vo.setBusinessType("msg_send");
        busTypeMsgProducer.send(vo);
        return vo;
    }


}
